package com.abing.starry.manager;

import org.jsoup.Jsoup;
import org.jsoup.nodes.Document;
import org.springframework.stereotype.Component;

import java.io.IOException;
import java.util.ArrayList;
import java.util.List;

/**
 * @Author CaptainBing
 * @Date 2024/8/16 20:41
 * @Description
 */
@Component
public class SearchPlatformManager {


    /**
     * 搜索图片
     * @param searchName
     * @return
     */
    public List<String> queryPicture(String searchName) {

        String microsoftSearchPrefix = "https://cn.bing.com/images/search?q";

        String completeUrl = microsoftSearchPrefix + searchName;

        try {
            Document document = Jsoup.connect(completeUrl).get();
            System.out.println();
        } catch (IOException e) {
            throw new RuntimeException(e);
        }

        return new ArrayList<>();
    }
}
